﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TaiLieu;

public partial class advance_search : System.Web.UI.UserControl
{
    public string id = "";
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void ddlMuc_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList ddl = (DropDownList)sender;
        ICollection<TaiLieu_download> list = TaiLieu_downloadDB.GetChildrenByParent(false, ConvertType.ToInt(ddl.SelectedValue));
        ListItem tam = new ListItem("--- chọn giá trị ----", "0");
        ddlLinhVuc.Items.Add(tam);
        foreach (TaiLieu_download dl in list)
        {
            tam = new ListItem(dl.Name, ConvertType.ToString(dl.Id));
            ddlLinhVuc.Items.Add(tam);
        }
        //DropDownList ddl = (DropDownList)sender;
        //this.ddlLinhVuc.DataSource = TaiLieu_downloadDB.GetChildrenByParent(false, ConvertType.ToInt(ddl.SelectedValue));
        //this.ddlLinhVuc.DataBind();
    }
    protected void ddlLinhVuc_SelectedIndexChanged1(object sender, EventArgs e)
    {
        DropDownList ddl = (DropDownList)sender;
        id = ddl.SelectedValue;
    }
}